package com.example.pagingdemo.db;

import androidx.paging.DataSource;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.pagingdemo.model.GithubUser;

import java.util.List;

/**
 * @author: tuyrt7 on 2020/9/9.
 */
@Dao
public interface GithubUserDao {

    @Insert
    void insertUsers(List<GithubUser> users);

    @Query("delete from github_user")
    void clear();

    @Query("select * from github_user")
    DataSource.Factory<Integer, GithubUser> getGithubUserList();
}
